//
// Created by wze-zero on 2024/10/20.
//
#include <iostream>

using namespace std;

int check(int num) {
    int sum = 0;
    while (num % 10 || num / 10) {
        sum += num % 10;
        num /= 10;
    }
    if (sum%5==0){
        return true;
    }else{
        return false;
    }
}

int main() {
    int num1, num2, count = 0;
    cin >> num1 >> num2;
    for (int i = num1; i < num2 + 1; ++i) {
        check(i) ? count++ : count;
    }
    cout << count << endl;
    return 0;
}